<span class="glyphicon glyphicon-map-marker" aria-hidden="true" style="position: absolute; top: 17px; left: 25px;">
    <span>系统</span> /
    <span>安全管理</span> /
    <span>数据库列表</span>
</span>
<div style="width: 100%;margin-top: 20px;">
    <a name="add" title="全部备份" class="btn edit-btn" href="javascript:backups('')">全部备份</a>
    <div class="table-responsive" style="border:0px solid #fff;">
        <table class="table"  border="1" width="100%" cellpadding="0" cellspacing="0" style="margin: 20px 0px;">
            <tr>
                <th width="10%">数据库表</th>
                <th width="10%">数据条数</th>
                <th width="10%">内存大小</th>
                <th width="18%">创建时间</th>
                <th width="18%">最后更新时间</th>
                <th width="16%">备注</th>
                <th width="">操作</th>
            </tr>
            {volist name="list" id="vo"}
            <tr>
                <td>{$vo.name}</td>
                <td>{$vo.rows}条</td>
                <td>{$vo.size}</td>
                <td>{$vo.create_time}</td>
                <td>{$vo.update_time}</td>
                <td>{$vo.comment}</td>
                <td>
                    <a name="edit" title="备份" class="btn edit-btn"
                       href="javascript:backups('{$vo.name}')">备份</a>
                    <a name="edit" title="优化" class="btn edit-btn"
                       href="javascript:optimization('{$vo.name}')">优化</a>
                </td>
            </tr>
            {/volist}
        </table>
    </div>
</div>
<script type="text/javascript">
    function optimization(name) {
        $.ajax({
            type:"POST",
            url:"{:url('Admin/Backups/optimization')}",
            data:{name:name},
            success:function (res) {
                layer.msg(res);
                setTimeout("index()",3000);
            }
        });
    }
    function backups(name) {
        $.ajax({
            type:"POST",
            url:"{:url('Admin/Backups/add')}",
            data:{name:name},
            success:function (res) {
                layer.msg(res);
                setTimeout("index()",3000);
            }
        });
    }
    function index() {
        window.location.href = window.location.href;
    }
</script>